﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProgNetComponentsDx.Design.Editors;
using ProgNetComponentsDx.Design.Designers;

namespace ProgNetComponentsDx.Browsers.Design
{
    public class BrowserGroupCollectionEditor : BaseGroupCollectionEditor
    {
        protected override ProgNetComponentsDx.Design.Designers.BaseGroupCollectionDesigner CreateDesignerForm()
        {
            return new BrowserGroupCollectionDesigner();
        }

        protected override Type BaseNametype
        {
            get { return typeof(BrowserNames); }
        }
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            BrowserContainer.ServiceProvider = provider;
            object obj = base.EditValue(context, provider, value);
            BrowserContainer.ServiceProvider = null;
            return obj;
        }
    }

    public class BrowserGroupCollectionDesigner : BaseGroupCollectionDesigner
    {
        protected override ProgNetComponents.Interfaces.INamedGroup CreateNewGroup()
        {
            return new BrowserGroup();
        }

        protected override ProgNetComponents.Interfaces.INamedObject CreateNewItem()
        {
            return new Browser();
        }
    }
}
